<?php
  // no direct access
  defined( '_JEXEC' ) or die( 'Restricted access' );
  jimport('joomla.application.component.controller');
  include('base.php');

  class PicController extends BaseController
  {
    var $_name = 'pic';
    
    function get_type_instances(){
    
      $data = array();
      
      $type = JRequest::getVar('type');
      $pic  = $this->getModel('pic', 'picmodel');
      
      $data = $pic->get_pic_type_instances($type);
      
      $result  = "<select id='pic_id' name='pic_id'>";
      foreach($data as $id => $value)
        $result .= "<option value=$id>$value</option>";
      $result .= "</select>";
      echo $result;
    }
    
  }
?>
